package io.renren.modules.sp.service.impl;

import io.renren.commons.dynamic.datasource.annotation.DataSource;
import io.renren.modules.sp.service.MainIndividualService;
import io.renren.modules.sys.dao.SysCommDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
@DataSource("slave1")
public class MainIndividualImpl implements MainIndividualService {

    @Autowired
    private SysCommDao sysCommDao;

    @Override
    public List<Map<String, Object>> queryMainIndividual() {
        // game_group_round_id 2小学组 、6中学组 8高中组
        String sql = "SELECT t.stu_no, " +
                " round( t.item_flightDuration / 1000, 2 ) duration," +
                " t.score " +
                " FROM main_individual t where t.score >0 " +
                " and t.game_group_round_id = 8 ";

        return sysCommDao.list(sql, null);
    }

}